package yja.gzw.app.activity

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentPagerAdapter
import yja.gzw.app.R
import yja.gzw.app.base.BaseActivity
import yja.gzw.app.databinding.ActivityWodehaoyouBinding
import yja.gzw.app.fragmentview.FensiFragment
import yja.gzw.app.fragmentview.HomeFragment
import yja.gzw.app.fragmentview.WodeFragment
import yja.gzw.app.fragmentview.WodeGuanzhuFragment
import yja.gzw.app.fragmentview.XiaoxiFragment
import yja.gzw.app.viewmodel.Mainviewmodel
import com.google.android.material.tabs.TabLayout

class WodehaoyouActiviry :BaseActivity<Mainviewmodel, ActivityWodehaoyouBinding>(R.layout.activity_wodehaoyou){
    val titles= mutableListOf<String>("粉丝","关注")
    val list_fragment= mutableListOf<Fragment>(
        FensiFragment(), WodeGuanzhuFragment()
    )

    override fun initView() {

        binding.fanhui.setOnClickListener {
            finish()

        }
        binding.viewpager.adapter=object : FragmentPagerAdapter(supportFragmentManager){
            override fun getCount(): Int {

                return list_fragment.size

            }

            override fun getItem(position: Int): Fragment {

                return list_fragment[position]

            }

            override fun getPageTitle(position: Int): CharSequence? {
                return titles[position]
            }

        }

        binding.tabs.setupWithViewPager(binding.viewpager)


    }

    override fun dataObservese() {

    }
}